package io.github.yidasanqian.vo;


import lombok.Data;

/**
 * @author chenlinyu
 */
@Data
public final class ResultVO {
    private static final long serialVersionUID = -3628772330396069406L;
    private Integer status;
    private String message;
    private Object data;
    private String reqContent;

    public ResultVO() {
    }

    private ResultVO(int status, String message, Object data) {
        this.status = status;
        this.message = message;
        this.data = data;
    }

    private ResultVO(int status, String message, String reqContent) {
        this.status = status;
        this.message = message;
        this.reqContent = reqContent;
    }

    public static ResultVO buildErrorResult(int status, String errMsg, String reqContent) {
        return new ResultVO(status, errMsg, reqContent);
    }

    public static ResultVO buildSuccessResult(int status, String message, Object data) {
        return new ResultVO(status, message, data);
    }
}
